<?php

class MemberEducation extends AppModel {
	var $name = "MemberEducation";
	var $useTable = "member_education_info";
	var $primaryKey = 'id';
	
	var $belongsTo = array(
		'SysParams1'=>array( //ツバサ 2012-02-23 在籍ステータス
			'className'=>'SysParams', 'order'=>'',
			'foreignKey'=>'"edu_status" = "SysParams1"."id" AND "SysParams1"."kbn" = \'edu_status\' and "SysParams1"."id"'
		),
		'SysParams10'=>array( //最終学位
			'className'=>'SysParams', 'order'=>'', 
			'foreignKey'=>'"edu_degree" = "SysParams10"."id" AND "SysParams10"."kbn" = \'education_id\' and "SysParams10"."id"' 
		) 
	);
	
	function doDelete($id) {
		
		$sql = "update member_education_info MemberEducation set deleted=now() " . " where MemberEducation.id in ($id)";
		$this->query($sql);
	}
	
	/*
	 * @author wang.wei add
	* 2012/03/14
	* */
	function doDeleteFormMemberId($member_id) {
	
		$sql = "update member_education_info MemberEducation set deleted=now() " . " where MemberEducation.member_id = '$member_id' and deleted is null";
		$this->query($sql);
	}

}
?>